package self.crypt.db;

import java.util.Arrays;
import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class SaveEncryptedData {
	
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Long id;
	@Persistent(serialized = "true")
	private byte[] encryptedData;
	@Persistent
	private String emailAddress;
	@Persistent
	private Date createDate;
	@Persistent
	private Date modifiedDate;
	@Persistent
	private String uniqueId;
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	public byte[] getEncryptedData() {
		return encryptedData;
	}
	public void setEncryptedData(byte[] encryptedData) {
		this.encryptedData = encryptedData;
	}
	public String getEmailAddress() {
		return emailAddress;
	}
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public Date getModifiedDate() {
		return modifiedDate;
	}
	public void setModifiedDate(Date modifiedDate) {
		this.modifiedDate = modifiedDate;
	}
	public String getUniqueId() {
		return uniqueId;
	}
	public void setUniqueId(String uniqueId) {
		this.uniqueId = uniqueId;
	}
	@Override
	public String toString() {
		return "SaveEncryptedData [createDate=" + createDate
				+ ", emailAddress=" + emailAddress + ", encryptedData="
				+ Arrays.toString(encryptedData) + ", id=" + id
				+ ", modifiedDate=" + modifiedDate + ", uniqueId=" + uniqueId
				+ "]";
	}
}
